package com.ys.service.base.impl;

import com.alibaba.fastjson.JSON;
import com.ys.entity.base.TbBaseInfoArea;
import com.ys.mapper.base.BaseDiyMapper;
import com.ys.mapper.base.TbBaseInfoAreaMapper;
import com.ys.service.base.TbBaseInfoAreaService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Map;


/**
 * 城市信息表
 */
@Service("tbBaseInfoAreaService")
public class TbBaseInfoAreaServiceImpl implements TbBaseInfoAreaService {
	private static final Logger logger = LoggerFactory.getLogger(TbBaseInfoAreaServiceImpl.class);

	@Autowired
	private TbBaseInfoAreaMapper tbBaseInfoAreaMapper;

	@Autowired
	private BaseDiyMapper baseDiyMapper;

	/**
	 * 新增
	 */
	@Override
	public TbBaseInfoArea add(Map<String, Object> params) throws Exception {
		TbBaseInfoArea tbBaseInfoArea = JSON.parseObject(JSON.toJSONString(params), TbBaseInfoArea.class);
		tbBaseInfoAreaMapper.insert(tbBaseInfoArea);
		return tbBaseInfoArea;
	}


	/**
	 * 删除全部城市信息
	 */
	@Override
	public void delAll() throws Exception {
		baseDiyMapper.delAllCity();
	}



}
